package com.atguigu.yygh.hosp.controller;
/*
 * @author: XueYouPeng
 * @time: 2023/6/5 13:52
 */

import com.atguigu.common.result.Result;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;

@RestController
@RequestMapping("/admin/hosp")
//@CrossOrigin //跨域
public class LoginController {

    /*
     * 管理员登陆
     * @author: XueYouPeng
     * @time: 2023/6/5 13:54
     */
     @PostMapping("/user/login")
     public Result login(){
         return Result.ok().code(20000).data("token","admin-token");
     }

     /*
      * 登录成功后获取用户信息接口
      * @author: XueYouPeng
      * @time: 2023/6/5 13:56
      */
      @GetMapping("/user/info")
      public Result info(){
          return Result.ok().code(20000)
                  .data("roles", Arrays.asList("admin"))
                  .data("introduction","我是尚医通后台管理员")
                  .data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif")
                  .data("name","管理员-薛有朋");
      }
}
